import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);
const router = new VueRouter({
    mode:'hash',
    routes:[
        {
            path:'/shouye',
            name:'shouye',
            component:()=>import('../views/ShouYe.vue'),
            meta:{
                show:true
            }
        },
        {
            path:'/itemdetail/:id',
            name:'itemdetail',
            component:()=>import('../views/shouye/ItemDetail.vue')
        },
        {
            path:'/fenlei',
            name:'fenlei',
            component:()=>import('../views/FenLei.vue'),
            meta:{
                show:true
            },
            children:[
                {
                    path:'dianshang',
                    name:'dianshang',
                    component:()=>import('../views/fenlei/DianShang.vue'),
                    meta:{
                        show:true
                    }
                },{
                    path:'shouxuan',
                    name:'shouxuan',
                    component:()=>import('../views/fenlei/ShouXuan.vue'),
                    meta:{
                        show:true
                    },
                    children:[
                        {
                            path:'shouxuaner',
                            name:'shouxuaner',
                            component:()=>import('../views/fenlei/shouxuan/shouxuaner.vue'),
                            meta:{
                                show:true
                            }
                        }
                    ]
                }
            ]
        },
        {
            path:'/car',
            name:'car',
            component:()=>import('../views/Car.vue'),
            meta:{
                show:true
            }
        },
        {
            path:'/',
            redirect:'/shouye'
        }

    ]
})
router.addRoute({
    path:'/additem',
    name:'addItem',
    component:()=>import('../views/AddItem.vue')
})
router.addRoute('shouye',{path:'test',name:'test',component:()=>import('../views/shouye/test.vue'),meta:{show:true}})


export default router;